#include <iostream>
#include <Windows.h>
//#define IOCTL_FILE_DISK_OPEN_FILE   CTL_CODE(FILE_DEVICE_FILE_DISK, 0x800, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)

int main()
{
	HANDLE h;
	DWORD junk = 0;
	DISK_GEOMETRY *pdg = NULL;
	h = CreateFile(__TEXT("\\\\.\\MyDevice"),
		GENERIC_ALL,          // open for writing
		0,                      // do not share
		NULL,                   // default security
		OPEN_EXISTING,             // create new file only
		FILE_ATTRIBUTE_NORMAL,  // normal file
		NULL);
	DefineDosDevice(DDD_RAW_TARGET_PATH, __TEXT("Z:"), __TEXT("\\Device\\MYDEVICE"));
	//DeviceIoControl(h, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0, pdg, sizeof(pdg), &junk, (LPOVERLAPPED)NULL);
	CloseHandle(h);
	return 1;
}